package com.smh.a01butteredInputOrOutputStream;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class BufferedStreamDemo2 {
    public static void main(String[] args) throws IOException {

        BufferedReader br = new BufferedReader(new FileReader("day27-code\\file\\a.txt"));

//        char[] chars = new char[1024*1024];
//        int len;
//        while ((len=br.read(chars))!=-1){
//            String s = new String(chars, 0, len);
//            System.out.println(s);
//        }
        //readLine方法每次读一行,遇到换行符停止,但是,他并不会把回车符存到内存中
        String s;
        //读一行
        while ((s = br.readLine()) != null) {
            System.out.println(s);
        }
        br.close();


    }
}
